#!/bin/bash
set -x

if [ -z $1 ]; then
  w=20
#  w=1000
else
  w=$1
fi

  set -x
# DEBUG=-Djava.util.logging.config.file=./paho/pahopub.properties
cl=p`hostname`

# publish to MQTT subscriber with mar431/440
# java ${DEBUG} svt.mqtt.mq.MqttSample -a publish -t "/USER/Li/APP/MsgOrdering" -m "b" -s "tcp://10.10.10.10:17915 tcp://10.10.10.10:17915" -N -1 -q 2 -w $w -O -i ${cl} -c false > /niagara/test/scale/Li2/${cl}.log 2>&1

# publish to MQTT subscriber with mar432/432
#  java ${DEBUG} svt.mqtt.mq.MqttSample -a publish -t "/USER/Li/APP/MsgOrdering" -m "b" -s "tcp://10.10.10.10:17915 tcp://10.10.10.10:17915" -N -1 -q 2 -w $w -O -i ${cl} -c false > /niagara/test/scale/Li2/${cl}.log 2>&1

# publish to WAS MDB topic with mar432/433
  java ${DEBUG} svt.mqtt.mq.MqttSample -a publish -t "/APP/MsgOrdering/USER/Li" -m "b" -s "tcp://10.10.10.10:17911 tcp://10.10.10.10:17911" -N -1 -q 2 -w $w -O -i ${cl} -c false > /niagara/test/scale/Li2/${cl}.log 2>&1

  set +x




